using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

namespace DeThi1
{
    public partial class frmMainForm : Form
    {
        TruyXuatDuLieu txdl;
        public frmMainForm()
        {
            InitializeComponent();
            string strChuoiKetNoi = "provider = microsoft.jet.oledb.4.0;data source = QuanLyBaiHat.mdb;";
            txdl = new TruyXuatDuLieu(strChuoiKetNoi);
            txdl.MoKetNoi();
        }

        private void btnThoatChuongTrinh_Click(object sender, EventArgs e)
        {
            Application.Exit();
        }

        private void frmMainForm_Load(object sender, EventArgs e)
        {
            dgvDanhSachAlbum.DataSource = clsAlbum.LayDanhSachAlbum(txdl).Tables["Album"];
        }

        private void btnThemAlbum_Click(object sender, EventArgs e)
        {
            frmThemAlbum them = new frmThemAlbum();
            them.Show();
        }

        public void CapNhatAlbum(DataSet dtSet)
        {
            //dgvDanhSachAlbum.ClearSelection();
            dgvDanhSachAlbum.DataSource = null;
            dgvDanhSachAlbum.DataSource = dtSet.Tables["Album"];
        }

        private void btnTimKiemBaiHat_Click(object sender, EventArgs e)
        {
            frmTimKiemBaiHat baihat = new frmTimKiemBaiHat();
            baihat.Show();
        }
    }
}